const express = require('express');
const router = express.Router();
const userController = require('../controllers/user.controller');
const { authenticate, authorize } = require('../middleware/auth');

// 管理员接口 - 用户管理
router.get('/', userController.getAllUsers);
router.get('/:id', userController.getUserById);
router.put('/:id/status', userController.updateUserStatus);
router.put('/:id/role', userController.updateUserRole);
router.delete('/:id', userController.deleteUser);

// 企业用户信息管理
router.get('/company/profile', authenticate, authorize('company'), userController.getCompanyProfile);
router.put('/company/profile', authenticate, authorize('company'), userController.updateCompanyProfile);

// 求职者信息管理
router.get('/job-seeker/profile', authenticate, authorize('job_seeker'), userController.getJobSeekerProfile);
router.put('/job-seeker/profile', authenticate, authorize('job_seeker'), userController.updateJobSeekerProfile);

module.exports = router;